﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Linq.Expressions;
using System.Data.Objects;
using System.Data.Entity;

namespace OpenWeb.Dal.Interfaces
{

  public interface IService<T>
   where T : class
  {
    void Add(T entity);
    void Attach(T entity);
    long Count();
    long Count(Expression<Func<T, bool>> whereCondition);
    void Delete(T entity);
    System.Collections.Generic.IList<T> GetAll();
    System.Collections.Generic.IList<T> GetAll(Expression<Func<T, bool>> whereCondition);
    System.Linq.IQueryable<T> GetQueryable();
    T GetSingle(Expression<Func<T, bool>> whereCondition);
    IObjectSet<T> ObjectSet { get; }
    IDbSet<T> DbSet { get; }
  }
}
